package com.groupbuying.currency.consumer.mq;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * class_name: CurrencyMQConfig
 * package: com.groupbuying.currency.consumer.mq
 * description: 积分中心 -  MQ配置
 * creat_user: Ywxd
 * creat_date: 2019/5/20
 * creat_time: 15:13
 **/
@Component
public class CurrencyMQConfig {
    public static  String TOPIC ;
    public static  String GROUP_ID;
    public static final String ACCESS_KEY = "LTAIkLoCSLqX7QFG";
    public static final String SECRET_KEY = "anr8xwxEFrN4Rq0Gjw5MXxELuDb12V";
    public static final String NAMESRV_ADDR = "http://onsaddr.mq-internet-access.mq-internet.aliyuncs.com:80";


    /* 注入对应中心的topic */
    @Value("${RocketMQ_Key.Currency.Topic}")
    private void setTOPIC(String TOPIC) {
        CurrencyMQConfig.TOPIC = TOPIC;
    }
    /* 注入对应中心的groupId */
    @Value("${RocketMQ_Key.Currency.GroupId}")
    private void setGroupId(String groupId) {
        CurrencyMQConfig.GROUP_ID = groupId;
    }

    /* Tags */
    /* 消费者订阅全部tag */
    public static final String ALL_TAG = "*";

    /* 积分增加 */
    public static final String CURRENCY_ADD = "CURRENCY_ADD";


    /* SEND_TO_PAY_TOPIC ADDED */
    public static String SEND_TO_PAY_TOPIC;
    @Value("${RocketMQ_Key.Pay.Topic}")
    private void setSEND_TO_PAY_TOPIC(String SEND_TO_PAY_TOPIC) {
        CurrencyMQConfig.SEND_TO_PAY_TOPIC = SEND_TO_PAY_TOPIC;
    }

    /* 积分支付回执Tag */
    public static final String TAG_PAY_STATE_SUCCESS = "CURPAYBACK";
    /* 积分支付结果发送到金融中心 */
    public static final String TAG_PAY_TO_FINANCIAL  = "TOFINANCIAL";
    //积分消费发送积分变动提醒通知
    public static final String TAG_PAY_FOR_SENDMESSAGE  = "FORSENDMESSAGE";

    //线上支付退款，退积分
    public static final String TAG_REBACK_CURRENCY  = "CURRENCYCHANGEINTEGRALS";
}
